<html>
<head><meta charset="utf-8"><title>i586 weirdness · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html">i586 weirdness</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230026180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230026180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230026180">(Mar 12 2021 at 13:13)</a>:</h4>
<p>I know we had some concerns about i586 but what exactly is the problem?  I've been working on the reduction ops and can't seem to get sum or product of lanes to work quite right on i586.</p>



<a name="230026273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230026273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230026273">(Mar 12 2021 at 13:14)</a>:</h4>
<p><span class="user-mention" data-user-id="281757">@Jubilee</span> I think you may have brought up i586 originally</p>



<a name="230039932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230039932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230039932">(Mar 12 2021 at 14:44)</a>:</h4>
<p>among other possible problems: i586 f32 ops are not all bit-preserving</p>



<a name="230043091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230043091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230043091">(Mar 12 2021 at 15:03)</a>:</h4>
<p>bit-preserving meaning?</p>



<a name="230043225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230043225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230043225">(Mar 12 2021 at 15:04)</a>:</h4>
<p>i586 uses 80-bit floating-point precision internally</p>



<a name="230043298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230043298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230043298">(Mar 12 2021 at 15:04)</a>:</h4>
<p>Because the x86 FPU is designed that way. You only get sane floating-point behavior with SSE (available on the i686 target)</p>



<a name="230043491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230043491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230043491">(Mar 12 2021 at 15:05)</a>:</h4>
<p>Oh right, forgot that it's 80 bits</p>



<a name="230046623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230046623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230046623">(Mar 12 2021 at 15:23)</a>:</h4>
<p>I wonder if some implementations of sum and product are moving to gp registers and rounding to 64 bits between operations?</p>



<a name="230065816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230065816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230065816">(Mar 12 2021 at 17:14)</a>:</h4>
<p>particularly: <code>f32::from_bits(x).to_bits() == x</code> does not always pass if the bits of X are nan, which means that sse bitwise operation emulation doesn't work right.</p>



<a name="230089571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230089571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230089571">(Mar 12 2021 at 20:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="312331">Caleb Zulawski</span> <a href="#narrow/stream/257879-project-portable-simd/topic/i586.20weirdness/near/230046623">said</a>:</p>
<blockquote>
<p>I wonder if some implementations of sum and product are moving to gp registers and rounding to 64 bits between operations?</p>
</blockquote>
<p>my understanding is that it's partly because the System V ABI specifies where results are supposed to be passed, values move in/out of the x87 registers as a result, and a canonicalizing operation occurs.</p>



<a name="230090110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230090110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230090110">(Mar 12 2021 at 20:10)</a>:</h4>
<p>I think on i586 I have to manually sum and product because LLVM is not respecting that same canonicalization</p>



<a name="230090149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/i586%20weirdness/near/230090149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/i586.20weirdness.html#230090149">(Mar 12 2021 at 20:10)</a>:</h4>
<p>Which is probably fine in most contexts but I think we'd rather have consistency here</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>